| Visual Basic (Declaration) | |
|---|---|
Public Overloads Overrides Function Read( _ ByVal buffer() As Byte, _ ByVal offset As Integer, _ ByVal count As Integer _ ) As Integer | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As MessagePartStream Dim buffer() As Byte Dim offset As Integer Dim count As Integer Dim value As Integer value = instance.Read(buffer, offset, count) | |
Parameters
- buffer
- The storage location for the received data.
- offset
- The zero-based position in the buffer at which to store the received data.
- count
- The maximum number of bytes to read.
Return Value
The total number of bytes read into the buffer. A return value of 0 indicates no data is left to read.| Exception | Description |
|---|---|
| System.IO.IOException | Thrown when the Stream is not readable. |
| System.ArgumentNullException | Thrown when the buffer or callback is null. |
| System.ArgumentOutOfRangeException | Thrown when the offset is less than zero or when count is less than or equal to zero. |
| System.ArgumentException | Thrown when the (offset + count) > buffer.Length. |
This method copies bytes from the Stream to buffer, starting from the position specified by offset and reading up to the number of bytes specified by count.
Target Platforms: Microsoft .NET Framework 2.0